package com.example.mobile2021606128wje0506;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private EditText etMainUserName;
    private EditText etMainPsw;
    private Button btnMainLogin;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        btnMainLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MainActivity.this,ShowDataActivity.class);
                intent.putExtra("userName",etMainUserName.getText().toString().trim());
               //
                Bundle bundle=new Bundle();
                bundle.putString("passWord",etMainPsw.getText().toString().trim());
                intent.putExtras(bundle);


                startActivity(intent);

            }
        });
    }

    private void initView() {
        etMainUserName = (EditText) findViewById(R.id.etMainUserName);
        etMainPsw = (EditText) findViewById(R.id.etMainPsw);
        btnMainLogin = (Button) findViewById(R.id.btnMainLogin);
    }
}